/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistencia;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author euzinha
 */
@Entity
@Table(name = "MATRICULA")
@NamedQueries({
    @NamedQuery(name = "Matricula.findAll", query = "SELECT m FROM Matricula m")})
public class Matricula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "ANO")
    private Integer ano;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "matriculaId")
    private Collection<Notas> notasCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "matriculaId1")
    private Collection<Notas> notasCollection1;
    @JoinColumn(name = "ALUNOS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Alunos alunosId;
    @JoinColumn(name = "ALUNOS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Alunos alunosId1;
    @JoinColumn(name = "DISCIPLINAS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Disciplinas disciplinasId;
    @JoinColumn(name = "DISCIPLINAS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Disciplinas disciplinasId1;
    @JoinColumn(name = "PROFESSORES_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Professores professoresId;
    @JoinColumn(name = "PROFESSORES_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Professores professoresId1;

    public Matricula() {
    }

    public Matricula(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAno() {
        return ano;
    }

    public void setAno(Integer ano) {
        this.ano = ano;
    }

    public Collection<Notas> getNotasCollection() {
        return notasCollection;
    }

    public void setNotasCollection(Collection<Notas> notasCollection) {
        this.notasCollection = notasCollection;
    }

    public Collection<Notas> getNotasCollection1() {
        return notasCollection1;
    }

    public void setNotasCollection1(Collection<Notas> notasCollection1) {
        this.notasCollection1 = notasCollection1;
    }

    public Alunos getAlunosId() {
        return alunosId;
    }

    public void setAlunosId(Alunos alunosId) {
        this.alunosId = alunosId;
    }

    public Alunos getAlunosId1() {
        return alunosId1;
    }

    public void setAlunosId1(Alunos alunosId1) {
        this.alunosId1 = alunosId1;
    }

    public Disciplinas getDisciplinasId() {
        return disciplinasId;
    }

    public void setDisciplinasId(Disciplinas disciplinasId) {
        this.disciplinasId = disciplinasId;
    }

    public Disciplinas getDisciplinasId1() {
        return disciplinasId1;
    }

    public void setDisciplinasId1(Disciplinas disciplinasId1) {
        this.disciplinasId1 = disciplinasId1;
    }

    public Professores getProfessoresId() {
        return professoresId;
    }

    public void setProfessoresId(Professores professoresId) {
        this.professoresId = professoresId;
    }

    public Professores getProfessoresId1() {
        return professoresId1;
    }

    public void setProfessoresId1(Professores professoresId1) {
        this.professoresId1 = professoresId1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Matricula)) {
            return false;
        }
        Matricula other = (Matricula) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.Matricula[id=" + id + "]";
    }

}
